Convert wav to gsm on linux

chris (2006-04-28 11:31:41)
13398 views
2 replies
This is a nifty way of converting all the wav files in the working directory to gsm format - useful if you want to record your own IVR prompts for asterisk..
for i in *.wav
do
        sox $i -r 8000 -c 1 $(basename $i .wav).gsm resample -ql
done

save the file as wav2gsm.sh, or add a shebang and save as wav2gsm and then call it like this:
./wav2gsm

All the wav files will be converted over in an instant...

christo
comment
akiles
2008-09-26 20:17:07

.gsm to .wav conversion

Can u also provide for the vice versa.

I mean .gsm to .wav conversion...

Thanks,
akiles
reply iconedit reply
R.
2009-12-22 11:28:13

real GSM compression

Adding -g switch:

...
        sox $i -r 8000 -g -c 1 $(basename $i .wav).gsm resample -ql
...

will make it REAL GSM compressed files:

RIFF (little-endian) data, WAVE audio, GSM 6.10, mono 8000 Hz

instead of just resampled:

RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

which is about 10 times larger.
reply iconedit reply